namespace ScrumSprintMonitor.Testbench.Impl
{
	#region #using Directives

	using System;
	using System.ComponentModel;

	using Infrastructure;

	#endregion

	public class TestBuildInfo : IBuildInfo
	{
		private DateTime buildFinishTime = SystemTime.Now();
		private string buildName = "Test Project";
		private string buildNumber = "1";
		private Exception exception;
		private string requestedFor = @"FARO_TWO\PombeirP";
		private BuildStatus status = BuildStatus.NotSetUp;

		#region Implementation of IBuildInfo

		public string Name
		{
			get { return this.buildName; }
			set
			{
				if (value != this.buildName)
				{
					this.buildName = value;

					OnPropertyChanged("Name");
				}
			}
		}

		public string Number
		{
			get { return this.buildNumber; }
			set
			{
				if (value != this.buildNumber)
				{
					this.buildNumber = value;

					OnPropertyChanged("Number");
				}
			}
		}

		public DateTime FinishTime
		{
			get { return this.buildFinishTime; }
			set
			{
				if (value != this.buildFinishTime)
				{
					this.buildFinishTime = value;

					OnPropertyChanged("FinishTime");
				}
			}
		}

		public BuildStatus Status
		{
			get { return this.status; }
			set
			{
				if (value != this.status)
				{
					this.status = value;

					OnPropertyChanged("Status");
				}
			}
		}

		public Exception Exception
		{
			get { return this.exception; }
			set
			{
				if (value != this.exception)
				{
					this.exception = value;

					OnPropertyChanged("Exception");
				}
			}
		}

		public string RequestedFor
		{
			get { return this.requestedFor; }
			set
			{
				if (value != this.requestedFor)
				{
					this.requestedFor = value;

					OnPropertyChanged("RequestedFor");
				}
			}
		}

		#endregion

		#region INotifyPropertyChanged members

		public event PropertyChangedEventHandler PropertyChanged;

		private void OnPropertyChanged(string propertyName)
		{
			if (PropertyChanged != null)
			{
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}

		#endregion
	}
}